import 'package:flutter/material.dart';
import 'package:flutter_changdian_football/pages/mine/my_purse/recharge_record/recharge_record_controller.dart';
import 'package:flutter_changdian_football/utils/pull/pull_smart_refresher.dart';
import 'package:flutter_changdian_football/widget/screenutil/custom_screenutil.dart';
import 'package:get/get.dart';

// 充值记录
class RechargeRecordWidget extends StatelessWidget {
  const RechargeRecordWidget({super.key});

  @override
  Widget build(BuildContext context) {
    return GetBuilder<RechargeRecordController>(
      init: RechargeRecordController(),
      builder: (rechargeRecordController) {
        return SizedBox(
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              Expanded(
                child: RefreshWidget<RechargeRecordController>(
                  child: ListView.builder(
                    itemCount: rechargeRecordController.userAccountRecordModelList.length,
                    padding: EdgeInsets.zero,
                    physics: const BouncingScrollPhysics(),
                    itemBuilder: (BuildContext context, int index) {
                      return Container(
                        padding: EdgeInsets.symmetric(horizontal: 17.w, vertical: 10.w),
                        child: Row(
                          children: [
                            Expanded(
                              child: Column(
                                crossAxisAlignment: CrossAxisAlignment.start,
                                children: [
                                  SizedBox(
                                    child: Text(rechargeRecordController.userAccountRecordModelList[index].description ?? '', style: TextStyle(fontSize: 15.sp, color: const Color(0xff333333)),),
                                  ),
                
                                  SizedBox(height: 3.w,),
                
                                  SizedBox(
                                    child: Text(rechargeRecordController.userAccountRecordModelList[index].recordTime ?? '', style: TextStyle(fontSize: 13.sp, color: const Color(0xffcccccc)),),
                                  )
                                ],
                              ),
                            ),
                
                            SizedBox(
                              child: Text(rechargeRecordController.userAccountRecordModelList[index].amountString ?? '', style: TextStyle(fontSize: 16.sp, color: const Color(0xff499360), fontWeight: FontWeight.w500),),
                            )
                          ],
                        ),
                      );
                    },
                  ),
                ),
              )
            ],
          ),
        );
      }
    );
  }
}